package YuanFuDao;

import java.util.*;
/**
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            TreeMap<Integer,Integer> map = new TreeMap<>();
            if(n==0){
                System.out.println(0);
            }else{
                int[][] time = new int[n][2];
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < 2; j++) {
                        time[i][j] = sc.nextInt();
                    }
                }

                for (int i = 0; i < n; i++) {
                    map.put(time[i][0],map.getOrDefault(time[i][0],0)+1);
                    map.put(time[i][1],map.getOrDefault(time[i][1],0)-1);
                }
                int active = 0,res = 0;
                for(int d : map.values()){
                    active += d;
                    if(active > res) res = active;
                }
                System.out.println(res);

            }
        }

    }

}




